<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>usb: xusb_dma_intr_storage.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">usb
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xusb__dma__intr__storage_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xusb_dma_intr_storage.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file has the USB example Mass storage device application function with SCSI command processing and related response preparation being implemented as a part of the interrupt handler. </p>
<dl class="section note"><dt>Note</dt><dd>The example is tested on MicroBlaze system on SP605 board, with caches included in the H/W design.</dd></dl>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who  Date     Changes
</p>
<hr/>
<p>
1.00a hvm  2/22/07 First release.
4.00a hvm  06/01/11 Signature parameter of Command Status word is
                initialized with 'U''S''B''S' in ProcessRxCmd function.
                CR611761 fix.
4.01a bss  11/01/11 Modified UsbIfIntrHandler function to unconditionally
                reset when USB reset is asserted (CR 627574).
4.03a bss  02/05/13 Updated the example to support Zynq
5.6   pm   07/05/23 Removed powerpc support.
5.6   pm   07/05/23 Added support for system device-tree flow.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a20c10bb6c0fae679e5f4309d4f82e8a1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#a20c10bb6c0fae679e5f4309d4f82e8a1">ReadTransfer</a> (<a class="el" href="struct_x_usb.html">XUsb</a> *InstancePtr)</td></tr>
<tr class="memdesc:a20c10bb6c0fae679e5f4309d4f82e8a1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function implements the reception of data in the USB device for the READ request from the USB Host.  <a href="#a20c10bb6c0fae679e5f4309d4f82e8a1">More...</a><br/></td></tr>
<tr class="separator:a20c10bb6c0fae679e5f4309d4f82e8a1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a92a7e0322925656f0e14d4f57dc004c9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#a92a7e0322925656f0e14d4f57dc004c9">WriteTransfer</a> (<a class="el" href="struct_x_usb.html">XUsb</a> *InstancePtr)</td></tr>
<tr class="memdesc:a92a7e0322925656f0e14d4f57dc004c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function implements the reception of data in the USB device for the WRITE request from the USB Host.  <a href="#a92a7e0322925656f0e14d4f57dc004c9">More...</a><br/></td></tr>
<tr class="separator:a92a7e0322925656f0e14d4f57dc004c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa76bf2e4a9d18c6362bdf783a067da6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#aaa76bf2e4a9d18c6362bdf783a067da6">DmaIntrHandler</a> (void *CallBackRef, u32 IntrStatus)</td></tr>
<tr class="memdesc:aaa76bf2e4a9d18c6362bdf783a067da6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the interrupt handler for the USB DMA events.  <a href="#aaa76bf2e4a9d18c6362bdf783a067da6">More...</a><br/></td></tr>
<tr class="separator:aaa76bf2e4a9d18c6362bdf783a067da6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This main function starts the USB application.  <a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br/></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b40155d0d9fa44133905dd9f6f02ee7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#a3b40155d0d9fa44133905dd9f6f02ee7">InitUsbInterface</a> (<a class="el" href="struct_x_usb.html">XUsb</a> *InstancePtr)</td></tr>
<tr class="memdesc:a3b40155d0d9fa44133905dd9f6f02ee7"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is the USB initialization function.  <a href="#a3b40155d0d9fa44133905dd9f6f02ee7">More...</a><br/></td></tr>
<tr class="separator:a3b40155d0d9fa44133905dd9f6f02ee7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bd3ecc4e2acd07b864ea2392a0394f4"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#a8bd3ecc4e2acd07b864ea2392a0394f4">UsbIfIntrHandler</a> (void *CallBackRef, u32 IntrStatus)</td></tr>
<tr class="memdesc:a8bd3ecc4e2acd07b864ea2392a0394f4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the interrupt handler for the USB mass storage device application.  <a href="#a8bd3ecc4e2acd07b864ea2392a0394f4">More...</a><br/></td></tr>
<tr class="separator:a8bd3ecc4e2acd07b864ea2392a0394f4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a243967b329b332dc3503adfc2950fceb"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#a243967b329b332dc3503adfc2950fceb">Ep0IntrHandler</a> (void *CallBackRef, u8 EpNum, u32 IntrStatus)</td></tr>
<tr class="memdesc:a243967b329b332dc3503adfc2950fceb"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the interrupt handler for the USB End point Zero events.  <a href="#a243967b329b332dc3503adfc2950fceb">More...</a><br/></td></tr>
<tr class="separator:a243967b329b332dc3503adfc2950fceb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a386bfc503aaebdfd92028284d6fb63f0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#a386bfc503aaebdfd92028284d6fb63f0">Ep1IntrHandler</a> (void *CallBackRef, u8 EpNum, u32 IntrStatus)</td></tr>
<tr class="memdesc:a386bfc503aaebdfd92028284d6fb63f0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the interrupt handler for the USB End point one events.  <a href="#a386bfc503aaebdfd92028284d6fb63f0">More...</a><br/></td></tr>
<tr class="separator:a386bfc503aaebdfd92028284d6fb63f0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6030c0dc187b2ca30a157d5c12fb3101"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#a6030c0dc187b2ca30a157d5c12fb3101">Ep2IntrHandler</a> (void *CallBackRef, u8 EpNum, u32 IntrStatus)</td></tr>
<tr class="memdesc:a6030c0dc187b2ca30a157d5c12fb3101"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function is the interrupt handler for the USB End point two events.  <a href="#a6030c0dc187b2ca30a157d5c12fb3101">More...</a><br/></td></tr>
<tr class="separator:a6030c0dc187b2ca30a157d5c12fb3101"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaa4db21dc45028300278c1c09cf97719"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#aaa4db21dc45028300278c1c09cf97719">ProcessRxCmd</a> (<a class="el" href="struct_x_usb.html">XUsb</a> *InstancePtr)</td></tr>
<tr class="memdesc:aaa4db21dc45028300278c1c09cf97719"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function processes mass storage specific commands and sends the required response.  <a href="#aaa4db21dc45028300278c1c09cf97719">More...</a><br/></td></tr>
<tr class="separator:aaa4db21dc45028300278c1c09cf97719"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3bc2a29a012dcb0b3c4afc5d2ed2843"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#aa3bc2a29a012dcb0b3c4afc5d2ed2843">Read10</a> (<a class="el" href="struct_x_usb.html">XUsb</a> *InstancePtr, PUSBCBW pCmdBlock, PUSBCSW pStatusBlock)</td></tr>
<tr class="memdesc:aa3bc2a29a012dcb0b3c4afc5d2ed2843"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function implements the transmission of data from the device to the READ request from the USB Host.  <a href="#aa3bc2a29a012dcb0b3c4afc5d2ed2843">More...</a><br/></td></tr>
<tr class="separator:aa3bc2a29a012dcb0b3c4afc5d2ed2843"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac7e4e799fabb2ebbea49a1eafd6625c8"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#ac7e4e799fabb2ebbea49a1eafd6625c8">Write10</a> (<a class="el" href="struct_x_usb.html">XUsb</a> *InstancePtr, PUSBCBW pCmdBlock, PUSBCSW pStatusBlock)</td></tr>
<tr class="memdesc:ac7e4e799fabb2ebbea49a1eafd6625c8"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function implements the reception of data in the USB device for the write request from the USB Host.  <a href="#ac7e4e799fabb2ebbea49a1eafd6625c8">More...</a><br/></td></tr>
<tr class="separator:ac7e4e799fabb2ebbea49a1eafd6625c8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad696da140ceb6e98f34ca83a0de9b2a6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#ad696da140ceb6e98f34ca83a0de9b2a6">MassStorageReset</a> (<a class="el" href="struct_x_usb.html">XUsb</a> *InstancePtr)</td></tr>
<tr class="memdesc:ad696da140ceb6e98f34ca83a0de9b2a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This routine is called when a RESET class command is received.  <a href="#ad696da140ceb6e98f34ca83a0de9b2a6">More...</a><br/></td></tr>
<tr class="separator:ad696da140ceb6e98f34ca83a0de9b2a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a58677e910a98e950bd94400b386584e0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xusb__dma__intr__storage_8c.html#a58677e910a98e950bd94400b386584e0">GetMaxLUN</a> (<a class="el" href="struct_x_usb.html">XUsb</a> *InstancePtr)</td></tr>
<tr class="memdesc:a58677e910a98e950bd94400b386584e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This routine is called when a GETMAXLUN class command is received.  <a href="#a58677e910a98e950bd94400b386584e0">More...</a><br/></td></tr>
<tr class="separator:a58677e910a98e950bd94400b386584e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="aaa76bf2e4a9d18c6362bdf783a067da6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void DmaIntrHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>IntrStatus</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the interrupt handler for the USB DMA events. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. </td></tr>
    <tr><td class="paramname">IntrStatus</td><td>is a bit mask indicating pending interrupts.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_usb.html#ab3ca87faf1aa1caaa6fa6e6f7c3e9267">XUsb::DeviceConfig</a>, <a class="el" href="xusb__dma__intr__storage_8c.html#aaa4db21dc45028300278c1c09cf97719">ProcessRxCmd()</a>, <a class="el" href="xusb__dma__intr__storage_8c.html#a20c10bb6c0fae679e5f4309d4f82e8a1">ReadTransfer()</a>, <a class="el" href="struct_x_usb___device_config.html#a39868eeb033b4118b6e80f11a819d79c">XUsb_DeviceConfig::Status</a>, <a class="el" href="xusb__dma__intr__storage_8c.html#a92a7e0322925656f0e14d4f57dc004c9">WriteTransfer()</a>, <a class="el" href="group__usb.html#gaa04141505aefe8349756ab664507892c">XUSB_DISCONNECTED</a>, <a class="el" href="group__usb.html#gabf09f948bc604c279cb0a12bba14057b">XUsb_EpDataSend()</a>, <a class="el" href="group__usb.html#ga0af96b0d4a531a296fcad1bf5ec8c41f">XUSB_STATUS_DMA_DONE_MASK</a>, and <a class="el" href="group__usb.html#ga114887e7b719e7c16785eb0aa38ba904">XUSB_STATUS_DMA_ERROR_MASK</a>.</p>

<p>Referenced by <a class="el" href="xusb__dma__intr__storage_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a243967b329b332dc3503adfc2950fceb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Ep0IntrHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>EpNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>IntrStatus</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the interrupt handler for the USB End point Zero events. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>is the callback reference passed from the interrupt. handler, which in our case is a pointer to the driver instance. </td></tr>
    <tr><td class="paramname">EpNum</td><td>is the end point number. </td></tr>
    <tr><td class="paramname">IntrStatus</td><td>is a bit mask indicating pending interrupts.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>EpNum is not used in this function as the handler is attached specific to end point zero. This parameter is useful when a single handler is used for processing all end point interrupts. </dd></dl>

<p>Referenced by <a class="el" href="xusb__dma__intr__storage_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>, <a class="el" href="xusb__keyboard_8c.html#aa8f2bcd4c9e30a4811003990864522af">UsbKbdExample()</a>, and <a class="el" href="xusb__mouse_8c.html#a714c06502349d8b6e0d080156ef14a1b">UsbMouseExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a386bfc503aaebdfd92028284d6fb63f0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Ep1IntrHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>EpNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>IntrStatus</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the interrupt handler for the USB End point one events. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. </td></tr>
    <tr><td class="paramname">EpNum</td><td>is the end point number. </td></tr>
    <tr><td class="paramname">IntrStatus</td><td>is a bit mask indicating pending interrupts.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>EpNum is not used in this function as the handler is attached specific to end point one. This parameter is useful when a single handler is used for processing all end point interrupts. </dd></dl>

<p>Referenced by <a class="el" href="xusb__dma__intr__storage_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>, <a class="el" href="xusb__keyboard_8c.html#aa8f2bcd4c9e30a4811003990864522af">UsbKbdExample()</a>, and <a class="el" href="xusb__mouse_8c.html#a714c06502349d8b6e0d080156ef14a1b">UsbMouseExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a6030c0dc187b2ca30a157d5c12fb3101"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Ep2IntrHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u8&#160;</td>
          <td class="paramname"><em>EpNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>IntrStatus</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the interrupt handler for the USB End point two events. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. </td></tr>
    <tr><td class="paramname">EpNum</td><td>is the end point number. </td></tr>
    <tr><td class="paramname">IntrStatus</td><td>is a bit mask indicating pending interrupts.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>EpNum is not used in this function as the handler is attached specific to end point two. This parameter is useful when a single handler is used for processing all end point interrupts. </dd></dl>

<p>Referenced by <a class="el" href="xusb__dma__intr__storage_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
<a class="anchor" id="a58677e910a98e950bd94400b386584e0"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void GetMaxLUN </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb.html">XUsb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This routine is called when a GETMAXLUN class command is received. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> instance of the controller.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xusb__storage_8h.html#a243967b329b332dc3503adfc2950fceb">Ep0IntrHandler()</a>.</p>

</div>
</div>
<a class="anchor" id="a3b40155d0d9fa44133905dd9f6f02ee7"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void InitUsbInterface </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb.html">XUsb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is the USB initialization function. </p>
<p>This example initializes the device for Mass Storage Application. The following configuration is done.</p>
<ul>
<li>EP0 : CONTROL end point, Bidirectional, Packet size 64 bytes.</li>
<li>EP1 : NON_ISOCHRONOUS, BULK_IN, packet size 512 bytes.</li>
<li>EP2 : NON_ISOCHRONOUS, BULK_OUT, packet size 512 bytes</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a class="anchor" id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This main function starts the USB application. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if successful.</li>
<li>XST_FAILURE if test fails. </li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_usb___config.html#a4c3940ad84a72a33f98856da250dab3f">XUsb_Config::BaseAddress</a>, <a class="el" href="struct_x_usb___device_config.html#aa2e570d2cf6027c87adee4304b6afd79">XUsb_DeviceConfig::CurrentConfiguration</a>, <a class="el" href="struct_x_usb.html#ab3ca87faf1aa1caaa6fa6e6f7c3e9267">XUsb::DeviceConfig</a>, <a class="el" href="xusb__dma__intr__storage_8c.html#aaa76bf2e4a9d18c6362bdf783a067da6">DmaIntrHandler()</a>, <a class="el" href="xusb__dma__intr__storage_8c.html#a243967b329b332dc3503adfc2950fceb">Ep0IntrHandler()</a>, <a class="el" href="xusb__dma__intr__storage_8c.html#a386bfc503aaebdfd92028284d6fb63f0">Ep1IntrHandler()</a>, <a class="el" href="xusb__dma__intr__storage_8c.html#a6030c0dc187b2ca30a157d5c12fb3101">Ep2IntrHandler()</a>, <a class="el" href="xusb__cp9_8h.html#a3b40155d0d9fa44133905dd9f6f02ee7">InitUsbInterface()</a>, <a class="el" href="xusb__dma__intr__storage_8c.html#a8bd3ecc4e2acd07b864ea2392a0394f4">UsbIfIntrHandler()</a>, <a class="el" href="group__usb.html#gaeab13bf4d5ed84b5b9e0c1c651f50aaa">XUsb_CfgInitialize()</a>, <a class="el" href="group__usb.html#ga6fbf5a1ddbca576e8c1e7d235da878ab">XUsb_DmaIntrSetHandler()</a>, <a class="el" href="group__usb.html#gae7fef0669e6d6094cc2af067195cc04d">XUsb_EpSetHandler()</a>, <a class="el" href="group__usb.html#gafcd3e91e72783087a0c6902724b8087f">XUsb_IntrEnable()</a>, <a class="el" href="group__usb.html#gacc119aa9f628ab0cc3fac2f63073e386">XUsb_IntrHandler()</a>, <a class="el" href="group__usb.html#gada7caf770f82936ab7493b67d143b9a9">XUsb_IntrSetHandler()</a>, <a class="el" href="group__usb.html#ga833556c2bbb9beb055873006fea7b2ed">XUsb_LookupConfig()</a>, <a class="el" href="group__usb.html#gaa2f7958d25023d2ed18cfaabfb2baa0f">XUsb_SetDeviceAddress()</a>, <a class="el" href="group__usb.html#ga4708ca8b9ca477b58d7da7db3f1be308">XUsb_Start()</a>, <a class="el" href="group__usb.html#ga10e255c9daa6899e2c231a9c839c76fe">XUSB_STATUS_DISCONNECT_MASK</a>, <a class="el" href="group__usb.html#gaf4f49b7f02066d4f04f49e7371fa851a">XUSB_STATUS_EP0_BUFF1_COMP_MASK</a>, <a class="el" href="group__usb.html#ga133213a1b921a479f9702f85e5120065">XUSB_STATUS_EP1_BUFF1_COMP_MASK</a>, <a class="el" href="group__usb.html#ga8fd881d64ceaa0b75f3e07ac891590f9">XUSB_STATUS_EP1_BUFF2_COMP_MASK</a>, <a class="el" href="group__usb.html#gaa1b33fb581374aebe866bdbcdcec97c0">XUSB_STATUS_EP2_BUFF1_COMP_MASK</a>, <a class="el" href="group__usb.html#gafe634ba137a5f8963b7364a32cd56a27">XUSB_STATUS_EP2_BUFF2_COMP_MASK</a>, <a class="el" href="group__usb.html#ga1c1388c1f5b3644140d0ced5dd7fceda">XUSB_STATUS_FIFO_BUFF_FREE_MASK</a>, <a class="el" href="group__usb.html#gadf5b97880da95d33c6d746d33ff28125">XUSB_STATUS_FIFO_BUFF_RDY_MASK</a>, <a class="el" href="group__usb.html#gaf35c023a0d3ac069b7ab105b1c0c2509">XUSB_STATUS_GLOBAL_INTR_MASK</a>, <a class="el" href="group__usb.html#gaa69331ab12d98b585ded8d8c69dad53a">XUSB_STATUS_RESET_MASK</a>, and <a class="el" href="group__usb.html#ga2b4ada8448d346e1a7460c2a02d779b6">XUSB_STATUS_SUSPEND_MASK</a>.</p>

</div>
</div>
<a class="anchor" id="ad696da140ceb6e98f34ca83a0de9b2a6"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void MassStorageReset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb.html">XUsb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This routine is called when a RESET class command is received. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> instance of the controller.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xusb__storage_8h.html#a243967b329b332dc3503adfc2950fceb">Ep0IntrHandler()</a>.</p>

</div>
</div>
<a class="anchor" id="aaa4db21dc45028300278c1c09cf97719"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ProcessRxCmd </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb.html">XUsb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function processes mass storage specific commands and sends the required response. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xusb__dma__intr__storage_8c.html#aaa76bf2e4a9d18c6362bdf783a067da6">DmaIntrHandler()</a>, and <a class="el" href="xusb__storage_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>.</p>

</div>
</div>
<a class="anchor" id="aa3bc2a29a012dcb0b3c4afc5d2ed2843"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Read10 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb.html">XUsb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PUSBCBW&#160;</td>
          <td class="paramname"><em>pCmdBlock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PUSBCSW&#160;</td>
          <td class="paramname"><em>pStatusBlock</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function implements the transmission of data from the device to the READ request from the USB Host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> instance. </td></tr>
    <tr><td class="paramname">pCmdBlock</td><td>is a pointer to the Mass Storage Command Block wrapper. </td></tr>
    <tr><td class="paramname">pStatusBlock</td><td>is a pointer to the Mass Storage Status wrapper.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xusb__storage_8h.html#aaa4db21dc45028300278c1c09cf97719">ProcessRxCmd()</a>.</p>

</div>
</div>
<a class="anchor" id="a20c10bb6c0fae679e5f4309d4f82e8a1"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void ReadTransfer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb.html">XUsb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function implements the reception of data in the USB device for the READ request from the USB Host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_usb___device_config.html#a53ebfe09517736ee2ca350e4d96e996c">XUsb_DeviceConfig::CurrentSpeed</a>, <a class="el" href="struct_x_usb.html#ab3ca87faf1aa1caaa6fa6e6f7c3e9267">XUsb::DeviceConfig</a>, <a class="el" href="group__usb.html#gaf18783c0d53b254b23bee3714df0c7b4">XUSB_EP_HIGH_SPEED</a>, and <a class="el" href="group__usb.html#gabf09f948bc604c279cb0a12bba14057b">XUsb_EpDataSend()</a>.</p>

<p>Referenced by <a class="el" href="xusb__dma__intr__storage_8c.html#aaa76bf2e4a9d18c6362bdf783a067da6">DmaIntrHandler()</a>, and <a class="el" href="xusb__storage_8h.html#a386bfc503aaebdfd92028284d6fb63f0">Ep1IntrHandler()</a>.</p>

</div>
</div>
<a class="anchor" id="a8bd3ecc4e2acd07b864ea2392a0394f4"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void UsbIfIntrHandler </td>
          <td>(</td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>CallBackRef</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>IntrStatus</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function is the interrupt handler for the USB mass storage device application. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">CallBackRef</td><td>is the callback reference passed from the interrupt handler, which in our case is a pointer to the driver instance. </td></tr>
    <tr><td class="paramname">IntrStatus</td><td>is a bit mask indicating pending interrupts.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xusb__dma__intr__storage_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main()</a>, <a class="el" href="xusb__keyboard_8c.html#aa8f2bcd4c9e30a4811003990864522af">UsbKbdExample()</a>, and <a class="el" href="xusb__mouse_8c.html#a714c06502349d8b6e0d080156ef14a1b">UsbMouseExample()</a>.</p>

</div>
</div>
<a class="anchor" id="ac7e4e799fabb2ebbea49a1eafd6625c8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Write10 </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb.html">XUsb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PUSBCBW&#160;</td>
          <td class="paramname"><em>pCmdBlock</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">PUSBCSW&#160;</td>
          <td class="paramname"><em>pStatusBlock</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function implements the reception of data in the USB device for the write request from the USB Host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> instance. </td></tr>
    <tr><td class="paramname">pCmdBlock</td><td>is a pointer to the Mass Storage Command Block wrapper. </td></tr>
    <tr><td class="paramname">pStatusBlock</td><td>is a pointer to the Mass Storage Status wrapper.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>Referenced by <a class="el" href="xusb__storage_8h.html#aaa4db21dc45028300278c1c09cf97719">ProcessRxCmd()</a>.</p>

</div>
</div>
<a class="anchor" id="a92a7e0322925656f0e14d4f57dc004c9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void WriteTransfer </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_x_usb.html">XUsb</a> *&#160;</td>
          <td class="paramname"><em>InstancePtr</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function implements the reception of data in the USB device for the WRITE request from the USB Host. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">InstancePtr</td><td>is a pointer to the <a class="el" href="struct_x_usb.html" title="The XUsb driver instance data. ">XUsb</a> instance.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="struct_x_usb___device_config.html#a53ebfe09517736ee2ca350e4d96e996c">XUsb_DeviceConfig::CurrentSpeed</a>, <a class="el" href="struct_x_usb.html#ab3ca87faf1aa1caaa6fa6e6f7c3e9267">XUsb::DeviceConfig</a>, <a class="el" href="group__usb.html#gaf18783c0d53b254b23bee3714df0c7b4">XUSB_EP_HIGH_SPEED</a>, <a class="el" href="group__usb.html#ga143b99da38f8de7e4d0f5cee108fc797">XUsb_EpDataRecv()</a>, and <a class="el" href="group__usb.html#gabf09f948bc604c279cb0a12bba14057b">XUsb_EpDataSend()</a>.</p>

<p>Referenced by <a class="el" href="xusb__dma__intr__storage_8c.html#aaa76bf2e4a9d18c6362bdf783a067da6">DmaIntrHandler()</a>, and <a class="el" href="xusb__storage_8h.html#a6030c0dc187b2ca30a157d5c12fb3101">Ep2IntrHandler()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
